<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title><?=$title?></title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <!-- bootstrap 3.0.2 -->
        <link href="<?=base_url()?>resources/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
        <!-- font Awesome -->
        <link href="<?=base_url()?>resources/bootstrap/css/font-awesome.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        <link href="<?=base_url()?>resources/bootstrap/css/ionicons.min.css" rel="stylesheet" type="text/css" />
        <!-- DATA TABLES -->
        <link href="<?=base_url()?>resources/bootstrap/css/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
         <link href="<?=base_url()?>resources/bootstrap/js/plugins/datatables/TableTools/css/dataTables.tableTools.css" rel="stylesheet" type="text/css" />
        <!-- Bootstrap Editable -->
        <link href="<?=base_url()?>resources/bootstrap/css/editable/css/bootstrap-editable.css" rel="stylesheet" type="text/css" />
         <link href="<?=base_url()?>resources/bootstrap/css/select2.css" rel="stylesheet" type="text/css" />
        <!-- Bootstrap Editable -->
        <link href="<?=base_url()?>resources/bootstrap/css/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css" />
        <link href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.0.2/fullcalendar.print.css" rel="stylesheet" type="text/css" media='print'/>
         <!-- Bootstrap datepicker -->
        <link href="<?=base_url()?>resources/bootstrap/css/datepicker/bootstrap-datetimepicker.css" rel="stylesheet" type="text/css" />
         <!-- Bootstrap colorpicker -->
        <link href="<?=base_url()?>resources/bootstrap/css/colorpicker/bootstrap-colorpicker.css" rel="stylesheet" type="text/css" />
        <!-- Blueimp -->
        <link href="<?=base_url(); ?>resources/upload/css/blueimp-gallery.css" rel="stylesheet" type="text/css">
        <!-- Theme style -->
        <link href="<?=base_url()?>resources/bootstrap/css/AdminLTE.css" rel="stylesheet" type="text/css" />
        <!-- Theme style reset-->
        <link href="<?=base_url()?>resources/admin/css/reset.css" rel="stylesheet" type="text/css" />
        

<!-- jQuery 2.0.2 -->
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
	<!-- masonry -->
	<script src="<?=base_url()?>resources/bootstrap/js/imagesloaded.pkgd.min.js"></script>
<script src="<?=base_url()?>resources/bootstrap/js/masonry.pkgd.min.js"></script>
<!-- jQuery UI 1.10.3 -->
      	<script src="<?=base_url()?>resources/bootstrap/js/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
<!-- Moment 1.10.3 -->
      	<script src="<?=base_url()?>resources/bootstrap/js/moment.js" type="text/javascript"></script>
	
<!-- Bootstrap -->
<script
	src="<?=base_url()?>resources/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
<!-- DATA TABES SCRIPT -->
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/datatables/jquery.dataTables.js"
	type="text/javascript"></script>
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/datatables/jquery.dataTables.columnFilter.js"
	type="text/javascript"></script>
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/datatables/dataTables.colVis.js"
	type="text/javascript"></script>
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/datatables/TableTools/js/dataTables.tableTools.js"
	type="text/javascript"></script>
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/datatables/dataTables.bootstrap.js"
	type="text/javascript"></script>
<!-- Editable -->
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/editable/js/bootstrap-editable.js"
	type="text/javascript"></script>
<!-- datepicker -->
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/datepicker/bootstrap-datetimepicker.js"
	type="text/javascript"></script>
<!-- colorpicker -->
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/colorpicker/bootstrap-colorpicker.min.js"
	type="text/javascript"></script>
<!-- Full Calendar -->
<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/fullcalendar/fullcalendar.js"
	type="text/javascript"></script>
	<script
	src="<?=base_url()?>resources/bootstrap/js/plugins/fullcalendar/lang/fr.js"
	type="text/javascript"></script>
<!-- blueimp -->
<script src="<?=base_url()?>resources/upload/js/jquery.blueimp-gallery.min.js"></script>

<!-- AdminLTE App -->
<script
	src="<?=base_url()?>resources/bootstrap/js/AdminLTE/app.js"
	type="text/javascript"></script>
<!-- page script -->
<script
	src="<?=base_url()?>resources/admin/js/tools.js" type="text/javascript"></script>
        
         <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
    
      <body class="skin-blue">
        <!-- header logo: style can be found in header.less -->
        <header class="header">
            <a href="<?=site_url()?>" class="logo">
                <!-- Add the class icon to your logo image or logo icon to add the margining -->
              <img src="<?=base_url()?>resources/admin/imgs/logo.png" title="logo" alt="logo" height="50">
            </a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="navbar-right">
                    <ul class="nav navbar-nav">
                        <!-- Tasks: style can be found in dropdown.less -->
                        <li class="dropdown tasks-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-tasks"></i>
                                <?php if(sizeof($toDoList)>0){?>
                                <span class="label label-danger"><?=sizeof($toDoList)?></span>
                                <?php }?>
                            </a>
                            <ul class="dropdown-menu">
                                <li class="header">Vous avez <?=sizeof($toDoList)?>  tâches dans 3 jours</li>
                                <li>
                                    <!-- inner menu: contains the actual data -->
                                    <ul class="menu">
                                    	<?php foreach ($toDoList as $list):?>
                                    	<li><!-- Task item -->
                                            <a href="<?php if($list->property_id){ echo site_url('properties/viewProperty').'/'.$list->property_id;}?>">
                                                <h3>
                                                   <?=$list->content?>
                                                   <?php if($list->property_id){?>
                                                    <span class="pull-right"><i class="fa fa-home"></i></span>
                                                    <?php }?>
                                                </h3>
                                                 <span class="label bg-<?=$list->color?>"><i class="fa fa-clock-o"></i> <?=date('d-M-Y @ H:m',strtotime($list->date_start))?></span>
                                            </a>
                                        </li><!-- end task item -->
                                    	<?php endforeach;?>
                                     
                                    </ul>
                                </li>
                                <li class="footer">
                                    <a href="#">aujourd'hui: <?=date('d-m-Y')?></a>
                                </li>
                            </ul>
                        </li>
                      
                        <!-- User Account: style can be found in dropdown.less -->
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span><?=$user->name?>  <i class="caret"></i></span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header bg-light-blue">
                                <?php if($user->avatar){?>
                					<img class="img-circle " src="<?=base_url()?>uploads/avatar/thumbs/<?=$user->avatar?>" width="200">
                					<?php }else{?>
                					<img class="img-circle " src="<?=base_url()?>uploads/avatar/thumbs/avatar_default.png" width="200">
                					<?php }?>
                                  
                                    <p>
                                        <?=$user->name?> 
                                        <small>Dernière Activité : <?=$user->last_activity?></small>
                                    </p>
                                </li>
                                 <!-- Menu Body -->
                            <!--   <li class="user-body">
                                    <div class="col-xs-4 text-center">
                                        <a href="#">Followers</a>
                                    </div>
                                    <div class="col-xs-4 text-center">
                                        <a href="#">Sales</a>
                                    </div>
                                    <div class="col-xs-4 text-center">
                                        <a href="#">Friends</a>
                                    </div>
                                </li>-->
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a href="<?=site_url()?>profile/<?=$user->id?>" class="btn btn-default btn-flat">Profile</a>
                                    </div>
                                    <div class="pull-right">
                                        <a href="<?=site_url()?>logout" class="btn btn-default btn-flat">Déconnexion</a>
                                    </div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
            <aside class="left-side sidebar-offcanvas">                
                <!-- sidebar: style can be found in sidebar.less -->
                <section class="sidebar">
                    <!-- Sidebar user panel -->
                    <div class="user-panel">
                        <div class="pull-left image">
                            <?php if($user->avatar){?>
                					<img class="img-circle " src="<?=base_url()?>uploads/avatar/thumbs/<?=$user->avatar?>" width="200">
                					<?php }else{?>
                					<img class="img-circle " src="<?=base_url()?>uploads/avatar/thumbs/avatar_default.png" width="200">
                					<?php }?>
                        </div>
                        <div class="pull-left info">
                            <p>Bonjour, <?=$user->name?> </p>

                            <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                        </div>
                    </div>
                 
                    <!-- sidebar menu: : style can be found in sidebar.less -->
                    <ul class="sidebar-menu">
                        <li class="active">
                            <a href="<?=site_url()?>">
                                <i class="fa fa-dashboard"></i> <span>Tableau de bord</span>
                            </a>
                        </li>
                
                        <li>
                            <a href="<?=site_url()?>calendar">
                                <i class="fa fa-calendar"></i> <span>Calendrier</span>                 
                                   <?php if(sizeof($toDoList)>0){?>
                                <small class="badge pull-right bg-red"><?=sizeof($toDoList)?></small>
                                    <?php }?>
                            </a>
                        </li>

                        
                            <li><a href="<?=site_url()?>customers"><i class="fa fa-folder"></i> Fiche Clients</a></li>
 							<li><a href="<?=site_url()?>properties"><i class="fa fa-home"></i> Fiche Biens</a></li>
 							
                        
                          <li class="treeview">
                            <a href="#">
                                <i class="fa fa-cogs"></i> <span>Configurations</span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?=site_url()?>users"><i class="fa fa-angle-double-right"></i> <i class="fa fa-user"></i>Équipes Viabilis</a></li>
                                <li><a href="<?=site_url()?>agents"><i class="fa fa-angle-double-right"></i> <i class="fa fa-users"></i>Représentants</a></li>

                            </ul>
                        </li>
                    </ul>
                </section>
                <!-- /.sidebar -->
            </aside>
